home *** CD-ROM | disk | FTP | other *** search
-
- ; ---------------------------------------------------------------------
- ; Complex example of double-buffered animation - support@blitzbasic.com
- ; ---------------------------------------------------------------------
- ; Uncommented version, to show how simple the code really is...
-
- Graphics 640, 480
- SetBuffer BackBuffer ()
-
- background = LoadImage ("george.bmp")
-
- player = LoadImage ("rocket.bmp")
- MaskImage player, 255, 0, 255
-
- foreground = LoadImage ("xmas.bmp")
- MaskImage foreground, 255, 0, 255
-
- x = 320
- y = 340
-
- Repeat
-
- Cls
-
- If KeyDown (203) Then x = x - 1 ; Left cursor
- If KeyDown (205) Then x = x + 1 ; Right cursor
- If KeyDown (200) Then y = y - 1 ; Up cursor
- If KeyDown (208) Then y = y + 1 ; Down cursor
-
- TileImage background
- DrawImage player, x, y
- DrawImage foreground, 0, 250
-
- Flip
-
- Until KeyHit (1)
-
- End
-